/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package uk.ac.shef.speech_r25;

import java.util.List;

/**
 *
 * @author samf
 */
class Segment {

    int start;
    int end;
    float score;
    static List<String> wordSeq;
    Segment() {

    }

    static void setWordSeq(List<String> wordSeq) {
        Segment.wordSeq = wordSeq;
    }
    Segment(int start, int end) {
        this.start = start;
        this.end = end;
    }

    public String toString() {
        String ret = "";
        List<String> subList = wordSeq.subList(start, end);
        for (String s : subList) {
            ret += s + " ";
        }

        return ret.trim();
    }

    String replace(int blank, String ans) {
        String ret = "";
        for (int i = start; i < end; ++i) {
            if (i == blank) {
                ret += ans + " ";
            } else {
                ret += wordSeq.get(i) + " ";
            }
        }
        return ret.trim();
    }

}
